#pragma once

#include "CTile.h"
#include <windows.h>
#include <string>
using std::string;

class CLayer
{
	int m_nLayerID;
	int m_nParentID;
	int m_nLayerType;

	CTile* m_tTileArray;
	int m_nTilesWide;
	int m_nTilesHigh;
	int m_nTileWidth;
	int m_nTileHeight;
	int m_nImageID;

public:

	CLayer( void );
	~CLayer( void );

	void SetID( int nID ) { m_nLayerID = nID; }
	void SetParentID( int nID ) { m_nParentID = nID; }
	void SetType( int nID ) { m_nLayerType = nID; }
	void SetTile( CTile tTile, int x, int y ){ m_tTileArray[ ( m_nTilesWide * y ) + x ] = tTile; }
	void SetColumns( int nColumns ) { m_nTilesWide = nColumns; }
	void SetRows( int nRows ) { m_nTilesHigh = nRows; }
	void SetTileWidth( int nWidth ) { m_nTileWidth = nWidth; }
	void SetTileHeight( int nHeight ) { m_nTileHeight = nHeight; }
	void SetImageID( int nID ) { m_nImageID = nID; }

	int GetID( void ) { return m_nLayerID; }
	int GetParentID( void ) { return m_nParentID; }
	int GetType( void ) { return m_nLayerType; }
	CTile GetTile( int x, int y ) { return m_tTileArray[ ( m_nTilesWide * y ) + x ]; }
	int GetColumns( void ) { return m_nTilesWide; }
	int GetRows( void ) { return m_nTilesHigh; }
	int GetTileWidth( void ) { return m_nTileWidth; }
	int GetTileHeight( void ) { return m_nTileHeight; }
	int GetImageID( void ) { return m_nImageID; }

	void Render( void );
	void CreateTileArray( int nRows, int nColumns ) { m_tTileArray = new CTile[ nRows * nColumns ]; }
};